$def with (course,user_data,error,post)

$#
$# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for
$# more information about the licensing of this file.
$#

$var title: $:course.get_name(user_manager.session_language())

$var Column: $:template_helper.call('course_admin_menu',course=course,current='students')

$def NavbarF():
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="$get_homepath()/course/$course.get_id()">$course.get_name(user_manager.session_language())</a></li>
            <li class="breadcrumb-item"><a href="$get_homepath()/admin/$course.get_id()" title=$:_('"Administration"') data-toggle="tooltip" data-placement="bottom">
                <i class="fa fa-user-secret"></i></a></li>
            <li class="breadcrumb-item active">
                <a href="#">
                    <i class="fa fa-user"></i> $:_("Students") <span class="sr-only">$:_("(current)")</span>
                </a>
            </li>
        </ol>
    </nav>
$var Navbar: $:NavbarF()

<h2>$:_("Students")</h2>

<div class="card">
    <div class="card-header">
        <ul class="nav nav-tabs card-header-tabs">
            <li class="nav-item">
                <a href="#tab_students" class="nav-link active" aria-controls="students" role="tab" data-toggle="tab">
                <i class="fa fa-user fa-fw"></i>&nbsp; $:_("Students")</a>
            </li>
            <li class="nav-item">
                <a href="#tab_staff" class="nav-link" aria-controls="staff" role="tab" data-toggle="tab">
                <i class="fa fa-user-secret fa-fw"></i>&nbsp; $:_("Teaching staff")</a>
            </li>
        </ul>
    </div>
    <div class="tab-content">
        <div role="tabpanel" class="card-body tab-pane active" id="tab_students">
            $:include.course_admin.student_list_table(course,user_data[len(course.get_staff()):len(user_data)], False)
            $if user_manager.has_admin_rights_on_course(course):
                <form method="post">
                    <div class="form-group row">
                        <div class="col-sm-9"><input class="form-control" name="username" placeholder="Student username" style="background-image: url(&quot;&quot;); background-repeat: no-repeat; background-attachment: scroll; background-size: 16px 18px; background-position: 98% 50%; cursor: auto;" autocomplete="off" type="text"></div>
                        <div class="col-sm-3"><button name="register" type="submit" class="btn btn-warning btn-block"><i class="fa fa-plus fa-lg"></i>$:_("Add student")</button></div>
                    </div>
                </form>
        </div>
        <div role="tabpanel" class="card-body tab-pane" id="tab_staff">
            $:include.course_admin.student_list_table(course,user_data[0:len(course.get_staff())], True)
        </div>
    </div>
</div>
